package com.imooc.service;

import com.imooc.dataobject.ProductInfo;
import com.imooc.dto.CartDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * ProductInfo Service
 * @author liuhuan
 * @date 2018/7/5 10:25
 * @description
 */
public interface ProductInfoService {
    /**
     * find one ProductInfo
     * @param productId
     * @return
     */
    ProductInfo findOne(String productId);

    /**
     * find all ProductInfo
     * @return
     */
    Page<ProductInfo> findAll(Pageable pageable);

    /**
     * find up ProductInfo by productStatus
     * @return
     */
    List<ProductInfo> findUpProduct();

    /**
     * save productInfo
     * @param productInfo
     * @return
     */
    ProductInfo save(ProductInfo productInfo);





    /**
     * 加库存
     * @param cartDTOList
     */
    void increaseStock(List<CartDTO> cartDTOList);

    /**
     * 减库存
     * @param cartDTOList
     */
    void decreaseStock(List<CartDTO> cartDTOList);
}
